#Copy files
echo "Configuring app ..."
cp python/home_automation_project/* home_automation/home_automation
cp python/jarvis_app/* home_automation/jarvis
cp -rf static home_automation/jarvis/static
cp -rf templates home_automation/jarvis/templates
echo ""

#collect static files, move to apache distro
echo "Consolidating static files"
sudo python home_automation/manage.py collectstatic --noinput
echo ""

#Set up database
echo "Setting up Database"
python home_automation/manage.py syncdb
echo ""

#Restart apache
echo "Restarting apache"
sudo /etc/init.d/apache2 restart
echo ""

echo "Deploy complete, site available to 127.0.0.1/jarvis"



